
<?php 
	require "Model.php";
	require "../common/connDB.php";
	//require "connDB.php";
	class userModel extends Model
	{
		

		public function __construct()
		{
			parent::__construct();
		}
		public function getUserList()
		{
 			$sql = "select * from user";
 			$data = $this-> conn -> query($sql);
 			return $data;	
		}

     //更新菜品，获取菜品信息
    public function getUserbyID(){
      $uid=$_GET['uid'];
   $sql="select * from food where uid=$uid";
      $data=$this->conn->query($sql);
      return $data;
    } 
    public function updateUserInfo(){
     
     //1.获取修改提交的内容
     $uid=$_POST['uid'];
     $name=$_POST['name'];
     $sex=$_POST['sex'];
     $password=$_POST['password'];
     $phone=$_POST['phone'];
  
   $sql="update user set name='{$name}',sex='{$sex}',password='{$password}',phone='{$phone}' where uid=$uid";

   echo $sql;
   $result=$this->conn->query($sql);//写入数据库
   return $result;
    }
    public function delUserInfo(){
          $uid=$_GET['uid'];
     
          $sql="delete from user where uid={$uid}";
          $result=$this->conn->query($sql);//写入数据库
          return $result;
        }

	}


 ?>